<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<script type="text/javascript">
		function update(){
			$("#form").attr("action","/admin/comCd/comCdUpdateOk.do");
			$("#form").submit();  
		}  
		
		function goList(){
			$("#form").attr("action","/admin/comCd/comCdList.do");
			$("#form").submit();       
		}  
</script>  
	
	<h2 class="sub-header">${title}</h2> 	
		<form class="form-horizontal" role="form" name="form" id="form" method="post">
		<input name="cdNo" id="cdNo" type="hidden" value="${comCdDetail.cdNo}">
		  <div class="form-group">    
		    <label for="inputEmail3" class="col-sm-2 control-label">코드 이름</label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" name="cdNm" id="cdNm" placeholder="코드 이름" value="${comCdDetail.cdNm }">
		    </div>  
		  </div>
		  <div class="form-group">
		    <label for="inputPassword3" class="col-sm-2 control-label">상세코드 번호</label>
		    <div class="col-sm-10">
		      	<select class="form-control" name="cdGrpNo" id="cdGrpNo">
					<option value="">상위코드</option>
					<c:forEach items="${selectorList}" var="selectorList" varStatus="status">
						<option value="${ selectorList.selectorNo }" <c:if test="${ comCdDetail.cdGrpNo eq selectorList.selectorNo }">selected="selected"</c:if>>${ selectorList.selectorNm }</option>
					</c:forEach>
				</select>    
		    </div>
		  </div>
		  <div class="form-group">
		    <label for="inputPassword3" class="col-sm-2 control-label">상세코드</label>
		    <div class="col-sm-10">  
		      <input type="text" class="form-control" name="cdGrp"  id="cdGrp" placeholder="상세코드" value="${comCdDetail.cdGrp }">
		    </div>
		  </div>
		  <div class="form-group">
		    <label for="inputPassword3" class="col-sm-2 control-label">코드</label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" name="cd"  id="cd" placeholder="코드" value="${comCdDetail.cd }">
		    </div>
		  </div>
		  <div class="form-group">
		    <label for="inputPassword3" class="col-sm-2 control-label">코드 설명</label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" name="cdInfo"  id="cdInfo" placeholder="코드 설명" value="${comCdDetail.cdInfo }">
		    </div>
		  </div>
		  <div class="form-group">
		    <div class="col-sm-offset-2 col-sm-10">  
		     	<a class="btn btn-default" href="#" onClick="update()">등록</a>
		     	<a class="btn btn-default" href="#" onClick="goList()">목록</a>
		    </div>
		  </div>
		</form>